#pragma once
#include "afxstd.h"
#include <wx/wx.h>
#include <wx/glcanvas.h>
class wxSceneTool;
class wxScene;
class wxSceneDocument;
class wxSceneCanvasBase :public wxGLCanvas
{
public:
    wxSceneCanvasBase(wxWindow* parent=(wxWindow*)NULL,
        wxWindowID id=wxID_ANY,
        const wxPoint &pos=wxDefaultPosition,
        const wxSize &size=wxDefaultSize,
        const wxString &name=wxT("OSG"),
        long style=0,
        int *attributes=0
        );
    ~wxSceneCanvasBase(void);
public:
    wxSceneTool *GetCurrentTool() const;
    wxSceneDocument* GetDocument() const;
private:
    wxSceneTool *pCurTool;
    wxSceneDocument *pDocument;

protected:
	virtual void OnMouse(wxMouseEvent &e);
    virtual void OnMouseMove(wxMouseEvent &e);
    virtual void OnMouseDown(wxMouseEvent &e);
    virtual void OnMouseUp(wxMouseEvent &e);
    virtual void OnMouseWheel(wxMouseEvent &e);
    virtual void OnKeyDown(wxKeyEvent &e);
    virtual void OnKeyUp(wxKeyEvent &e);
    virtual void wxPaint(wxPaintEvent& e);


protected:
    virtual void OnPaint(wxPaintEvent& e);
    virtual void OnSize(wxSizeEvent &e);
    
DECLARE_EVENT_TABLE()
public:
	void OnMouseCaptureLost(wxMouseCaptureLostEvent& evt);
	void SetCurrentTool(wxSceneTool* pCurTool);
};

